package com.soft.zosagent.common;


import org.apache.log4j.Level;
import org.apache.log4j.Logger;

/**
 * @description: 日志打印
 * @author: cinbo，chenyinbo
 * @create: 2020-12-07 15:40
 */
public class LoggerPrint {

    private static Logger logger = Logger.getLogger(LoggerPrint.class);
    private String preStr="";
    //client or server
    private String side;
    private static boolean isOpenSystem=true;

    public void setPreStr(String preStr) {
        this.preStr = preStr;
    }
    public LoggerPrint(String side){
        this.side = side;
    }


    public static void consoleLog(String msg, LogLevel lvl){
        if(!isOpenSystem) {

        }else {
            if (lvl == LogLevel.DEBUG) {
                logger.debug(msg);
            } else if (lvl == LogLevel.INFO) {
                logger.info(msg);
            } else if (lvl == LogLevel.ERROR) {
                logger.error(msg);
            } else if (lvl == LogLevel.TRACE) {
                logger.trace(msg);
            }
        }
    }
}
